Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImplicitSpecies.n can be space and time dependent #886

Conversation

RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Oct 2, 2024

Proposed changes

This fixes #644 by allowing the n attribute of ImplicitSpecies to be a function of x and t.

Pinging @kaelyndunnell

Usage:

density_func= lambda x: 10 - 10 * x[0]

empty = F.ImplicitSpecies(n=density_func, name="empty", others=[trapped_H])

Step function:

density_func= lambda x: ufl.conditional(ufl.gt(x[0], 0.5), 10, 0.0)

empty = F.ImplicitSpecies(n=density_func, name="empty", others=[trapped_H])

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@RemDelaporteMathurin RemDelaporteMathurin linked an issue Oct 2, 2024 that may be closed by this pull request
@RemDelaporteMathurin RemDelaporteMathurin removed the request for review from jhdark October 2, 2024 21:23
@RemDelaporteMathurin RemDelaporteMathurin marked this pull request as draft October 2, 2024 21:23
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.84%. Comparing base (8c5a965) to head (ad0ff2a).
Report is 35 commits behind head on fenicsx.

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #886      +/-   ##
===========================================
+ Coverage    97.80%   97.84%   +0.04%     
===========================================
  Files           44       44              
  Lines         2142     2182      +40     
===========================================
+ Hits          2095     2135      +40     
  Misses          47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RemDelaporteMathurin RemDelaporteMathurin marked this pull request as ready for review October 3, 2024 12:49
@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark November 3, 2024 00:42
@RemDelaporteMathurin RemDelaporteMathurin added enhancement New feature or request fenicsx Issue that is related to the fenicsx support labels Nov 5, 2024
@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark November 9, 2024 18:30
@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark December 8, 2024 18:43
@RemDelaporteMathurin
Copy link
Collaborator Author

@jhdark would you mind giving this a look?

Copy link
Collaborator

@jhdark jhdark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should an implicit species not also be able to be temperature dependent?

@RemDelaporteMathurin
Copy link
Collaborator Author

Should an implicit species not also be able to be temperature dependent?

What does this mean exactly?

@RemDelaporteMathurin
Copy link
Collaborator Author

Should an implicit species not also be able to be temperature dependent?

So we discussed this internally and James' question was about having an annealing term (temperature dependent) affecting the empty trap concentration: this is now doable directly with Reaction and shouldn't be related to ImplicitSpecies

@RemDelaporteMathurin RemDelaporteMathurin merged commit 819379a into festim-dev:fenicsx Jan 14, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trap density varies in space and time
2 participants